package auto;

import org.openqa.selenium.By;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: DELL
 * Date: 2023-04-09
 * Time: 9:44
 */
public class AutoDemo5 {
    // 选择框中上传文件
    public void file() {
        EdgeOptions options = new EdgeOptions();
        options.addArguments("--remote-allow-origins=*");
        EdgeDriver driver = new EdgeDriver(options);

        driver.get("XXXXX");
        // 寻找文件上传框
        driver.findElement(By.cssSelector("文件选择框路径XXXXXX")).sendKeys("\\ 上传文件路径-本地路径\\ 文件名称");

        driver.quit();
    }
}
